<!-- Dom模板 -->
<template>
  <div class="ConfirmOrderMain confirmOrderMains">
    <!-- Dom内容 -->
    <!-- 标题 -->
    <div class="confirmOrderTitle" style="padding: 0;">
      <p class="turnP" @click="closeConfirmOrder">
        <i class="iconfont icon-zuojiantou-01"></i>
      </p>
      <p class="titles">确认订单</p>
    </div>
    <div class="contentsDiv">
      <!-- 收货地址 -->
      <div class="receivingAddress" @click="turnAddress">
        <div class="personMessage">
          <p>
            <i class="iconfont icon-dizhi-01"></i>
            <span>收货人：user</span>
          </p>
          <p>15532153572</p>
        </div>
        <div class="address">
          收货地址：<span>北京市昌平区沙河镇沙阳路18号</span>
        </div>
      </div>
      <!-- 订单详情 -->
      <div class="orderDetails">
        <div class="shopOrder" v-for="item in $store.state.yanqq.checkArr" :key="item.collection_id" @click="turnShopDetails(item)">
          <div>
            <img :src="item.goods_url" />
          </div>
          <div>
            <p class="titleP">{{item.goods_name}}</p>
            <p class="specs">
              <span style="background-color: #eaeaea; display: inline-block; padding: 2px 4px;">15ml</span>
            </p>
            <div class="pricesDiv">
              <p class="red">￥<span>{{item.price}}</span></p>
              <p>x{{item.goods_number}}</p>
            </div>
          </div>
        </div>
      </div>
      <!-- 优惠--配送 -->
      <div class="discountDiv">
        <p>
          <span>优惠金额</span>
          <span class="red">-￥0</span>
        </p>
        <p>
          <span>配送方式</span>
          <span>免邮</span>
        </p>
      </div>
      <!-- 发票--留言 -->
      <div class="discountDiv">
        <p>
          <span>发票</span>
          <span>
            不开发票
            <i
              class="iconfont icon-angle-right"
              style="font-size: 20px; vertical-align: middle;"
            ></i>
          </span>
        </p>
        <p style="justify-content: start;">
          <span>买家留言</span>
          <input
            type="text"
            placeholder="给卖家留言(45字以内)"
            style="margin-top: 4px; border: 0; font-size: 15px; padding-left: 10px;"
          />
        </p>
      </div>
      <!-- 总价 -->
      <div class="discountDiv">
        <p>
          <span>商品价格</span>
          <span>￥{{$store.state.yanqq.prices}}</span>
        </p>
        <p>
          <span>运费</span>
          <span>￥0.00</span>
        </p>
        <p>
          <span>税费</span>
          <span>￥0.00</span>
        </p>
      </div>
    </div>
      <!-- 提交订单 -->
      <div class="submitOrder" style="padding: 0;">
        <p>总计：<span class="red">￥{{$store.state.yanqq.prices}}</span></p>
        <p class="settleP">
          <button class="settleButton" @click="openPayAway">提交订单</button>
        </p>
      </div>
     
  </div>
</template>


<script>
// import a from './a'; // 引入组件
export default {
  components:{
  },
  name: "",
  data() {
    return {
      msg: '测试',
    }
  },
  // 生命周期 - 创建完成（访问当前this实例）
  created() {},
  // 生命周期 - 挂载完成（访问DOM元素）
  mounted() {
  },
  // Vue方法定义
  methods: {
    // 返回上一界面
      closeConfirmOrder(){
        this.$router.history.go(-1);
      },
      openPayAway(){
        this.$router.push("/payAway");
      },
      closePayAway(){
          this.payAwayFlags(false)
      },
      // 选择地址页面
      turnAddress(){
        this.$router.push("/site")
      },
      // 跳转商品详情
      turnShopDetails(item){
      this.$router.push({path:"/details", query:{...item}});
      }
  }
};
</script>

<style scoped>
/* @import url(''); 引入css类 */
@import url("../../fonts/iconfont.css");
.confirmOrderMains > div {
  background-color: #fff;
}
.contentsDiv{
  height: calc(100vh - 5.9rem);
  overflow-y: auto;
  background-color: #ddd!important;
}
.orderDetails>div{
  padding: 10px 0;
}
.contentsDiv > div {
  padding: 10px 20px;
  background-color: #fff;
  margin-bottom: 10px;
}

/* 标题 */
.turnP {
  position: fixed;
  left: 10px;
  top: 2px;
  height: 44px;
  line-height: 44px;
}
.turnP .iconfont {
  font-size: 24px;
}
.titles {
  margin-top: 0;
  text-align: center;
  font-size: 18px;
  height: 44px;
  line-height: 44px;
}

/* 收货地址 */
.personMessage {
  display: flex;
  font-size: 15px;
  justify-content: space-between;
}
.address {
  font-size: 14px;
  color: #999999;
  padding: 8px;
}

/* 订单详情 */
.shopOrder {
  width: 100%;
  display: flex;
  justify-content: space-between;
}
.shopOrder img {
  width: 100px;
  height: 100px;
  vertical-align: middle;
}
.shopOrder > div:nth-child(2) {
  padding: 0 20px;
  font-size: 14px;
  display: flex;
  flex-flow: column;
  justify-content: space-between;
}
.pricesDiv {
  display: flex;
  justify-content: space-between;
}

/* 优惠--配送 */
/* 发票--留言 */
/* 总价 */
.discountDiv > p {
  display: flex;
  padding-right: 6px;
  align-items: center;
  justify-content: space-between;
}
.discountDiv > p + p {
  padding: 6px 6px 0px 0px;
}

/* 发票--留言 */

/* 提交订单 */
.submitOrder {
  position: fixed;
  left: 0;
  bottom: 0;
  display: flex;
  justify-content: space-between;
  width: 100%;
  height: 49px;
  line-height: 49px;
}
.submitOrder > p:nth-child(1) {
  padding: 0 8px;
  box-sizing: border-box;
}
.settleButton {
  color: #fff;
  width: 110px;
  height: 49px;
  outline: none;
  border: 0;
  right: 0px;
  font-size: 15px;
  position: absolute;
  background-color: red;
}

/* 公共样式 */
.red {
  color: red;
}

/* 确认订单页 */
.ConfirmOrderMain {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 2;
  width: 100vw;
  height: 100vh;
  background-color: #e4e4e4;
  transition: all 0.5s ease-in-out;
}

</style>

</style>
